package com.atguigu.gmall.pms.api;

import com.atguigu.gmall.common.bean.PageParamVo;
import com.atguigu.gmall.common.bean.ResponseVo;
import com.atguigu.gmall.pms.entity.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * @Author zhaoshuo
 * @ClassName PmsApi
 * @Description
 */
public interface PmsApi {

    @ApiOperation("search服务远程查询spu分页数据")
    @GetMapping("pms/spu/page")
    ResponseVo<List<SpuEntity>> querySpuListByPage(@SpringQueryMap PageParamVo paramVo);//?

    @GetMapping("pms/brand/{id}")
    @ApiOperation("品牌详情查询")
    ResponseVo<BrandEntity> queryBrandById(@PathVariable("id") Long id);

    @ApiOperation("分类详情查询")
    @GetMapping("pms/category/{id}")
    ResponseVo<CategoryEntity> queryCategoryById(@PathVariable("id") Long id);

    @ApiOperation("search服务查询检索属性和值")
    @GetMapping("pms/spuattrvalue/spu/{spuId}")
    ResponseVo<List<SpuAttrValueEntity>> querySpuSearchAttrValues(@PathVariable("spuId") Long spuId);

    @ApiOperation("查询spu的sku列表")
    @GetMapping("pms/sku/spu/{spuId}")
    ResponseVo<List<SkuEntity>> querySkusBySpuId(@PathVariable("spuId") String spuId);

    @ApiOperation("search服务查询sku检索属性和值")
    @GetMapping("pms/skuattrvalue/sku/{skuId}")
    ResponseVo<List<SkuAttrValueEntity>> querySkuSearchAttrValues(@PathVariable("skuId") Long skuId);

    @GetMapping("pms/spu/{id}")
    @ApiOperation("详情查询")
    ResponseVo<SpuEntity> querySpuById(@PathVariable("id") Long id);

    @ApiOperation("查询指定parentId分类集合")
    @GetMapping("pms/category/parent/{parentId}")
    ResponseVo<List<CategoryEntity>> parent(@PathVariable("parentId") String parentId);

    @ApiOperation("根据1级分类id查询2、3级分类集合")
    @GetMapping("pms/category/lv2AndSubsCates/{cid}")
    ResponseVo<List<CategoryEntity>> lv2AndSubsCates(@PathVariable("cid") String cid);
}